package model;

import java.util.Vector;

/**
 * Team EBE
 * 
 * DiagramImpl.java represents a UML diagram, and maintains a list of classes 
 * and list of relationships between classes
 *
 */
public class DiagramImpl {
	private int sizeX, sizeY, numClasses;
	
	Vector<ClassImpl> classes;
	Vector<RelationshipImpl> relationships;
	
	public int getSizeX() {
		return sizeX;
	}

	public void setSizeX(int sizeX) {
		this.sizeX = sizeX;
	}

	public int getSizeY() {
		return sizeY;
	}

	public void setSizeY(int sizeY) {
		this.sizeY = sizeY;
	}
	
	public DiagramImpl(){
		sizeX = 1024;
		sizeY = 768;
		classes = new Vector<ClassImpl>();
		relationships = new Vector<RelationshipImpl>();		
	}
	
	public ClassImpl getClassImpl(int i){
		return classes.get(i);
	}
	public RelationshipImpl getRelationshipImpl(int i){
		return relationships.get(i);
	}
	
	public void addClass (String nameIn){
		ClassImpl classIn = new ClassImpl(nameIn);
		classes.add(classIn);
		++ numClasses;
	}
	
	public void addClass (int ox, int oy){
		classes.add(new ClassImpl (ox, oy));
		System.out.println("abeokd");
		++numClasses;
	}
	
	public void addClass(ClassImpl toAdd){
		classes.add(toAdd);
		++numClasses;
	}
	
	public void addRelationship(AnchorPoint src, AnchorPoint dest){
		RelationshipImpl relIn = new RelationshipImpl(src, dest);
		relationships.add(relIn);
	}

}
